// 对象结构转JSON互转
#ifndef __XJ_OBJECT_CO_JSON_H__
#define __XJ_OBJECT_CO_JSON_H__

#include "object_descriptor.h"

#ifdef __cplusplus
extern "C" {
#endif

// 对象结构转JSON对象
int object_co_json (const char *name, void *obj, void *obj_desc_ptr, int32_t obj_field_count, void *json_obj, int depth);
// JSON对象转对象结构
int json_co_object (const char *name, void *json_obj, void *obj, void *obj_desc_ptr, int32_t obj_field_count,  int depth);
// 对象结构释放
int object_free(const char *name, void *obj, void *obj_desc_ptr, int32_t obj_field_count);

// 对象结构转JSON字符串
int object_co_json_str (const char *name, void *obj, void *obj_desc_ptr, int32_t obj_field_count, char *json_str, uint64_t str_size, int depth);
// JSON字符串转对象结构
int json_str_co_object (const char *name, char *json_str, uint64_t str_size, void *obj, void *obj_desc_ptr, int32_t obj_field_count,  int depth);
// 获取JSON字符串长度
int get_json_str_size(const char *name, void *obj, void *obj_desc_ptr, int32_t obj_field_count);



#ifdef __cplusplus
}
#endif

#endif // __XJ_OBJECT_CO_JSON_H__